<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>转正申请</title>
    <script src="../../../../../res/js/jquery-3.4.1.min.js" charset="utf-8"></script>
    <script src="../../../../../res/js/login_common.js" charset="utf-8"></script>
    <script src="../../../../../res/layui/layui.js" charset="utf-8"></script>
    <script src="../../../../../res/js/Tools.js" charset="utf-8"></script>
    <link rel="shortcut icon" type="image/x-icon" href="../../../../../res/images/favicon.ico">
    <link rel="stylesheet" href="../../../../../res/layui/css/layui.css" media="all">
</head>
<body style="padding: 10px">
<div style="display: none" id="bodys">
    <form action="" class="layui-form layui-form-pane" lay-filter="example">
        <h1 align="center" style="margin-bottom: 20px">员工转正薪资定级表</h1>
        <!--流程id-->
        <input name="pkRegularId" id="pkRegularId" type="hidden"/>
        <!--流程进度-->
        <input name="isRevision" id="isRevision" type="hidden"/>
        <!--员工id-->
        <input name="personnelId" id="personnelId" type="hidden"/>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">员工工号</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" name="employeeNumber"
                           id="employeeNumber" placeholder="请输入工号（必填）" disabled=""
                           type="text"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" lay-verify="required" name="personnelName"
                           id="personnelName" placeholder="请输入名字（必填）" disabled=""
                           type="text"/>
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">入职日期</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" id="affirmTime" lay-verify="date"
                           name="affirmTime" disabled=""
                           placeholder="yyyy-MM-dd（必填）"
                           type="text">
                </div>
            </div>

            <div class="layui-inline">
                <label class="layui-form-label">部门</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" lay-verify="required" id="departmentName"
                           name="departmentName" placeholder="请输入部门（必填）" disabled=""
                           type="text"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">岗位</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" lay-verify="required" id="postName"
                           name="postName" placeholder="请输入岗位（必填）" disabled=""
                           type="text"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">生效日期</label>
                <div class="layui-input-inline">
                    <input autocomplete="off" class="layui-input" lay-verify="date" name="regularEffectiveDate"
                           id="regularEffectiveDate" placeholder="生效日期（必填）"
                           type="text"/>
                </div>
            </div>
        </div>

        <div style="width: 45%;float: left">
            <fieldset class="layui-elem-field">
                <legend>调整前</legend>
                <div class="layui-field-box">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">基本工资</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularBeforeSalary"
                                       id="regularBeforeSalary" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">住房补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularBeforeHousing"
                                       id="regularBeforeHousing" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">交通补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularBeforeTraffic"
                                       id="regularBeforeTraffic" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">社保补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularBeforeSocialSecurity"
                                       id="regularBeforeSocialSecurity" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">工龄补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularBeforeSeniority"
                                       id="regularBeforeSeniority" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">其他补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularBeforeElse"
                                       id="regularBeforeElse" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">合计</label>
                            <div class="layui-input-block">
                                <input type="text" name="regularBeforeTotal" id="regularBeforeTotal" lay-verify="required|number" autocomplete="off"
                                       placeholder="合计" disabled
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
            </fieldset>
        </div>

        <div style="width: 45%;float: left">
            <fieldset class="layui-elem-field">
                <legend>调整后</legend>
                <div class="layui-field-box">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">基本工资</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularLaterSalary"
                                       id="regularLaterSalary" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">住房补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularLaterHousing"
                                       id="regularLaterHousing" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">交通补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularLaterTraffic"
                                       id="regularLaterTraffic" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">社保补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularLaterSocialSecurity"
                                       id="regularLaterSocialSecurity" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">工龄补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularLaterSeniority"
                                       id="regularLaterSeniority" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">其他补贴</label>
                            <div class="layui-input-inline">
                                <input autocomplete="off" class="layui-input" lay-verify="required|number"
                                       name="regularLaterElse"
                                       id="regularLaterElse" placeholder="请输入（必填）"
                                       type="text"/>
                            </div>
                        </div>

                        <div class="layui-form-item">
                            <label class="layui-form-label">合计</label>
                            <div class="layui-input-block">
                                <input type="text" name="regularLaterTotal" id="regularLaterTotal" lay-verify="required|number" autocomplete="off"
                                       placeholder="合计" disabled
                                       class="layui-input">
                            </div>
                        </div>

                    </div>
                </div>
            </fieldset>
        </div>

        <div class="layui-form-item layui-form-text" id="department" style="display: none">
            <label class="layui-form-label">员工所在部门审核意见：</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" name="regularDepartmentOpinion" id="regularDepartmentOpinion">  </textarea>
            </div>
        </div>

        <div class="layui-form-item layui-form-text" id="staffing" style="display: none">
            <label class="layui-form-label">人事部审核意见：</label>
            <div class="layui-input-block">
                <textarea class="layui-textarea" name="regularPersonnelOpinion" id="regularPersonnelOpinion">  </textarea>
            </div>
        </div>

        <!-- 提交-->
        <div class="layui-form-item" id="sub">
            <div class="layui-input-block" id="flowTwo">
                <button type="submit" class="layui-btn site-demo-active" lay-submit="" lay-filter="demo1">通过</button>
                <input type="button" id="demo3" class="layui-btn layui-btn-primary site-demo-active" value="不通过"/>
            </div>
        </div>
    </form>

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
        <legend>流程日志</legend>
    </fieldset>
    <ul class="layui-timeline" id="schedule">

    </ul>
</div>
<script>
    let pkRegularId = getQueryString("pkRegularId");
    let show = getQueryString("show");
    layui.use(['form', 'laydate', 'table'], function () {
        var table = layui.table
            , form = layui.form
            , layer = layui.layer
            , laydate = layui.laydate;

        //生效日期
        laydate.render({
            elem: '#regularEffectiveDate'
        });

        let res;
        if (pkRegularId) {

            $("#pkRegularId").val(pkRegularId);
            //查询员工转正流程
            res = getAjaxById(getRootPath() + "OaRegularFlowAction/findById/" + pkRegularId);
            $("#isRevision").val(res.isRevision);
            // R 为人事填写 D 为部门审核 S 为人事审核
            if(res.isRevision === "R"){
                //调用R的方法
                staffingNode(res);
                $("#demo3").hide();
            }else if(res.isRevision === "D"){
                //这里面调用D的方法 D的方法里面调用了R的方法
                auditSectionNode(res);
            }else if(res.isRevision === "C"){
                // 这里调用C的方法 C的方法里面调用了D的方法
                auditStaffingNode(res)
            }else if(show){
                //全部审核完毕禁用所有控件 查看页面
                isShow(res);
            }
            //入职日期赋值
            $("#affirmTime").val(dateFormat('yyyy-MM-dd', new Date(res.affirmTime)));

            //通过人员id查询申请人信息
            let ress = getAjaxById(getRootPath() + "OaPersonnelAction/findById/" + res.personnelId);
            // 员工名称
            $("#personnelName").val(ress.data.personnelName);
            // 员工工号
            $("#employeeNumber").val(ress.data.employeeNumber);
            // 员工id
            $("#personnelId").val(ress.data.pkPersonnelId);
            // 部门
            $("#departmentName").val(ress.data.departmentName);
            // 岗位
            $("#postName").val(ress.data.postName);
            form.render();
        }


        if (res) {
            /* // 员工名称
             $("#personnelName").val(res.personnelName);
             // 员工工号
             $("#employeeNumber").val(res.employeeNumber);
             // 员工id
             $("#personnelId").val(res.pkPersonnelId);*/


            // 查询入职时间
            let data = getAjaxById(getRootPath()+"oaEntryFlowAction/findByPersonnelId");
            if(data){
                $("#affirmTime").val(dateFormat('yyyy-MM-dd', new Date(data.affirmTime)));
            }
            /*// 部门
            $("#departmentName").val(res.departmentName);
            // 岗位
            $("#postName").val(res.postName);*/

            form.render();
        }


        //监听起草提交
        form.on('submit(demo1)', function (data) {

            console.info(data.field);
            // 单击之后提交按钮不可选,防止重复提交
            const DISABLED = 'layui-btn-disabled';
            let site_demo_active=$('.site-demo-active');
            // 增加样式
            site_demo_active.addClass(DISABLED);
            // 增加属性
            site_demo_active.attr('disabled', 'disabled');
            let url="OaRegularFlowAction/staffing";
            if(data.field.isRevision === "D"){
                url="OaRegularFlowAction/sectionPass";
            }else if(data.field.isRevision === "C"){
                url="OaRegularFlowAction/staffingPass";
            }
            const res = postAjax(getRootPath() + url, data.field);
            if (res.code === 1) {
                layer.msg('新增成功3秒后关闭当前窗口', {icon: 1});
                setTimeout(function () {
                    formClose();
                }, 3000);
                setTimeout(function () {
                    parent.layui.table.reload('test');//刷新父页面
                    //window.parent.location.reload();//刷新父页面
                    const index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);
                }, 3000);
                //window.location.reload();//刷新页面
            } else if (res.code === 500) {
                error('500');
            } else {
                layer.msg("新增失败");
            }
            return false;
        });

        //监听审核提交不通过
        $('#demo3').on('click', function () {
            //prompt层
            layer.prompt({
                formType: 2,
                value: '',
                title: '请输入原因',
                area: ['300px', '100px']
            }, function (text, index) {
                layer.close(index);
                let datas = {
                    formReason: text,
                    pkRegularId: $("#pkRegularId").val(),
                    personnelId:$("#personnelId").val()
                };
                // 单击之后提交按钮不可选,防止重复提交
                const DISABLED = 'layui-btn-disabled';
                let site_demo_active=$('.site-demo-active');
                // 增加样式
                site_demo_active.addClass(DISABLED);
                // 增加属性
                site_demo_active.attr('disabled', 'disabled');

                let url="OaRegularFlowAction/sectionNoPass";
                if($("#isRevision").val() === "C"){
                    url="OaRegularFlowAction/staffingNoPass";
                }
                /*layer.msg('您最后写下了：'+text);*/
                const res = postAjax(getRootPath() + url, datas);
                if (res.code === 1) {
                    layer.msg('提交成功3秒后关闭当前窗口', {icon: 1});
                    setTimeout(function () {
                        formClose();
                    },3000);
                    setTimeout(function () {
                        parent.layui.table.reload('test');//刷新父页面
                        //window.parent.location.reload();//刷新父页面
                        const index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);
                    },3001);
                } else if (res.code === 500) {
                    error('500');
                } else {
                    layer.msg("新增失败");
                }
            });

            return false;
        });

        if(pkRegularId){
            const ress = getAjaxById(getRootPath() + "OaFlowAction/selectFlowSchedule/" + $("#pkRegularId").val());
            $("#schedule").html("");
            $.each(ress, function (index, item) {
                if (item.createdBy) {
                    $("#schedule").append('<li class="layui-timeline-item">\n' +
                        '        <i class="layui-icon layui-timeline-axis"></i>\n' +
                        '        <div class="layui-timeline-content layui-text">\n' +
                        '            <h3 class="layui-timeline-title">' + dateFormat('yyyy-MM-dd hh:mm:ss', new Date(item.createdTime)) + '&nbsp;&nbsp;&nbsp;' + item.flowName + '</h3>\n' +
                        '            <p>' + item.formReason + '</p>\n' +
                        '            <p>操作人：' + item.createdBy + '</p>\n' +
                        '        </div>\n' +
                        '    </li>')
                } else {
                    $("#schedule").append('<li class="layui-timeline-item">\n' +
                        '        <i class="layui-icon layui-timeline-axis"></ i>\n' +
                        '        <div class="layui-timeline-content layui-text">\n' +
                        '            <h3 class="layui-timeline-title">' + dateFormat('yyyy-MM-dd hh:mm:ss', new Date(item.createdTime)) + '&nbsp;&nbsp;&nbsp;' + item.flowName + '</h3>\n' +
                        '            <p>' + item.formReason + '</p>\n' +
                        '        </div>\n' +
                        '    </li>')
                }
            });
        }

        if (isButton("ENTRY_CHECK") && $("#isRevision").val() === "L") {
            $("#entryCheck").show();
            $("#trialDate").attr("lay-verify", "required");
            $("#trialMoney").attr("lay-verify", "required");
            $("#officialMoney").attr("lay-verify", "required");
        }
        $("#bodys").show();
        form.render();

        /**
         * 前基本工资
         **/
        $("#regularBeforeSalary").on("blur",function () {
            beforeTotal();
        });

        /**
         * 前住房补贴
         **/
        $("#regularBeforeHousing").on("blur",function () {
            beforeTotal();
        });

        /**
         * 前交通补贴
         **/
        $("#regularBeforeTraffic").on("blur",function () {
            beforeTotal();
        });

        /**
         * 前社保补贴
         **/
        $("#regularBeforeSocialSecurity").on("blur",function () {
            beforeTotal();
        });

        /**
         * 前工龄补贴
         **/
        $("#regularBeforeSeniority").on("blur",function () {
            beforeTotal();
        });

        /**
         * 前其他补贴
         **/
        $("#regularBeforeElse").on("blur",function () {
            beforeTotal();
        });

        /**
         * 后基本工资
         **/
        $("#regularLaterSalary").on("blur",function () {
            laterTotal();
        });

        /**
         * 后住房补贴
         **/
        $("#regularLaterHousing").on("blur",function () {
            laterTotal();
        });

        /**
         * 后交通补贴
         **/
        $("#regularLaterTraffic").on("blur",function () {
            laterTotal();
        });

        /**
         * 后社保补贴
         **/
        $("#regularLaterSocialSecurity").on("blur",function () {
            laterTotal();
        });

        /**
         * 后工龄补贴
         **/
        $("#regularLaterSeniority").on("blur",function () {
            laterTotal();
        });

        /**
         * 后其他补贴
         **/
        $("#regularLaterElse").on("blur",function () {
            laterTotal();
        });

    });

    /**
     * 调整前计算总和
     **/
    function beforeTotal() {
        let regularBeforeSalary = Number($("#regularBeforeSalary").val()); // 基本工资
        let regularBeforeHousing= Number($("#regularBeforeHousing").val()); // 住房补贴
        let regularBeforeTraffic= Number($("#regularBeforeTraffic").val()); // 交通补贴
        let regularBeforeSocialSecurity= Number($("#regularBeforeSocialSecurity").val()); // 社保补贴
        let regularBeforeSeniority= Number($("#regularBeforeSeniority").val()); // 工龄补贴
        let regularBeforeElse= Number($("#regularBeforeElse").val()); // 其他补贴
        let regularBeforeTotal=(regularBeforeSalary*100+regularBeforeHousing*100+regularBeforeTraffic*100+regularBeforeSocialSecurity*100+regularBeforeSeniority*100+regularBeforeElse*100)/100;
        $("#regularBeforeTotal").val(regularBeforeTotal.toFixed(2)); // 合计
    }

    /**
     * 调整后计算总和
     **/
    function laterTotal() {
        let regularLaterSalary = Number($("#regularLaterSalary").val()); // 基本工资
        let regularLaterHousing= Number($("#regularLaterHousing").val()); // 住房补贴
        let regularLaterTraffic= Number($("#regularLaterTraffic").val()); // 交通补贴
        let regularLaterSocialSecurity= Number($("#regularLaterSocialSecurity").val()); // 社保补贴
        let regularLaterSeniority= Number($("#regularLaterSeniority").val()); // 工龄补贴
        let regularLaterElse= Number($("#regularLaterElse").val()); // 其他补贴
        let regularLaterTotal=(regularLaterSalary*100+regularLaterHousing*100+regularLaterTraffic*100+regularLaterSocialSecurity*100+regularLaterSeniority*100+regularLaterElse*100)/100;
        $("#regularLaterTotal").val(regularLaterTotal.toFixed(2)); // 合计
    }


    /**
     * 人事填写
     */
    function staffingNode(data) {
        let res=getAjaxById(getRootPath()+"OaPersonnelAction/findById/"+data.personnelId);
        // 入职时间
        let affirmTime=$("#affirmTime");
        affirmTime.val(data.affirmTime);
        formDisabled(affirmTime);

        // 人员名称
        let personnelName=$("#personnelName");
        personnelName.val(res.data.personnelName);
        formDisabled(personnelName);
        // 人员编号
        let employeeNumber=$("#employeeNumber");
        employeeNumber.val(res.data.employeeNumber);
        formDisabled(employeeNumber);
        // 部门
        let departmentName=$("#departmentName");
        departmentName.val(res.data.departmentName);
        formDisabled(departmentName);
        // 岗位
        let postName=$("#postName");
        postName.val(res.data.postName);
        formDisabled(postName);

        //后
        // 基本工资
        let regularLaterSalary=$("#regularLaterSalary");
        regularLaterSalary.val(data.regularLaterSalary);

        // 住房补贴
        let regularLaterHousing=$("#regularLaterHousing");
        regularLaterHousing.val(data.regularLaterHousing);

        // 交通补贴
        let regularLaterTraffic=$("#regularLaterTraffic");
        regularLaterTraffic.val(data.regularLaterTraffic);

        // 社保补贴
        let regularLaterSocialSecurity=$("#regularLaterSocialSecurity");
        regularLaterSocialSecurity.val(data.regularLaterSocialSecurity);

        // 工龄补贴
        let regularLaterSeniority=$("#regularLaterSeniority");
        regularLaterSeniority.val(data.regularLaterSeniority);

        // 其他补贴
        let regularLaterElse=$("#regularLaterElse");
        regularLaterElse.val(data.regularLaterElse);

        //合计
        let regularLaterTotal=$("#regularLaterTotal");
        regularLaterTotal.val(data.regularLaterTotal);

        //前
        // 基本工资
        let regularBeforeSalary=$("#regularBeforeSalary");
        regularBeforeSalary.val(data.regularBeforeSalary);

        // 住房补贴
        let regularBeforeHousing=$("#regularBeforeHousing");
        regularBeforeHousing.val(data.regularBeforeHousing);

        // 交通补贴
        let regularBeforeTraffic=$("#regularBeforeTraffic");
        regularBeforeTraffic.val(data.regularBeforeTraffic);

        // 社保补贴
        let regularBeforeSocialSecurity=$("#regularBeforeSocialSecurity");
        regularBeforeSocialSecurity.val(data.regularBeforeSocialSecurity);

        // 工龄补贴
        let regularBeforeSeniority=$("#regularBeforeSeniority");
        regularBeforeSeniority.val(data.regularBeforeSeniority);

        // 其他补贴
        let regularBeforeElse=$("#regularBeforeElse");
        regularBeforeElse.val(data.regularBeforeElse);

        //合计
        let regularBeforeTotal=$("#regularBeforeTotal");
        regularBeforeTotal.val(data.regularBeforeTotal);

        if(data.regularEffectiveDate){
            // 生效日期
            let regularEffectiveDate=$("#regularEffectiveDate");
            regularEffectiveDate.val(dateFormat('yyyy-MM-dd', new Date(data.regularEffectiveDate)));
        }


    }

    /**
     * 禁用
     *  @param forms 控件
     */
    function formDisabled(forms) {
        const DISABLED = 'layui-btn-disabled';
        forms.attr('disabled', 'disabled');
        forms.addClass(DISABLED);
    }

    /**
     * 部门审核
     * @param data 流程模型
     */
    function auditSectionNode(data) {
        staffingNode(data);
        //后
        // 基本工资
        let regularLaterSalary=$("#regularLaterSalary");
        formDisabled(regularLaterSalary);

        // 住房补贴
        let regularLaterHousing=$("#regularLaterHousing");
        formDisabled(regularLaterHousing);

        // 交通补贴
        let regularLaterTraffic=$("#regularLaterTraffic");
        formDisabled(regularLaterTraffic);

        // 社保补贴
        let regularLaterSocialSecurity=$("#regularLaterSocialSecurity");
        formDisabled(regularLaterSocialSecurity);

        // 工龄补贴
        let regularLaterSeniority=$("#regularLaterSeniority");
        formDisabled(regularLaterSeniority);

        // 其他补贴
        let regularLaterElse=$("#regularLaterElse");
        formDisabled(regularLaterElse);

        //合计
        let regularLaterTotal=$("#regularLaterTotal");
        formDisabled(regularLaterTotal);

        //前
        // 基本工资
        let regularBeforeSalary=$("#regularBeforeSalary");
        formDisabled(regularBeforeSalary);

        // 住房补贴
        let regularBeforeHousing=$("#regularBeforeHousing");
        formDisabled(regularBeforeHousing);

        // 交通补贴
        let regularBeforeTraffic=$("#regularBeforeTraffic");
        formDisabled(regularBeforeTraffic);

        // 社保补贴
        let regularBeforeSocialSecurity=$("#regularBeforeSocialSecurity");
        formDisabled(regularBeforeSocialSecurity);

        // 工龄补贴
        let regularBeforeSeniority=$("#regularBeforeSeniority");
        formDisabled(regularBeforeSeniority);

        // 其他补贴
        let regularBeforeElse=$("#regularBeforeElse");
        formDisabled(regularBeforeElse);

        //合计
        let regularBeforeTotal=$("#regularBeforeTotal");
        formDisabled(regularBeforeTotal);

        // 生效日期
        let regularEffectiveDate=$("#regularEffectiveDate");
        formDisabled(regularEffectiveDate);

        //部门填写
        let department=$("#department");
        $("#department textarea").attr("lay-verify","required");
        department.show();
    }

    /**
     * 人事审核
     * @param data 流程模型
     */
    function auditStaffingNode(data) {
        auditSectionNode(data);

        // 人事意见
        let regularDepartmentOpinion=$("#regularDepartmentOpinion");
        regularDepartmentOpinion.val(data.regularDepartmentOpinion);
        formDisabled(regularDepartmentOpinion);
        let staffing=$("#staffing");
        $("#staffing textarea").attr("lay-verify","required");
        staffing.show();
    }

    /**
     * 查看页面
     * @param data 流程模型
     */
    function isShow(data) {
        auditStaffingNode(data);
        // 部门意见
        let regularPersonnelOpinion=$("#regularPersonnelOpinion");
        regularPersonnelOpinion.val(data.regularPersonnelOpinion);
        formDisabled(regularPersonnelOpinion);
        $("#sub").remove();
    }
</script>
</body>
</html>